{% extends "layout.html" %}
{% if rendered %}{% set title = "Suggest changes - Preview" %}
{% else %}{% set title = "Suggest changes" %}{% endif %}
{% block body %}
{% if rendered %}
  <h1>Preview</h1>
  <div class="preview">
    <div class="previewwrapper">
      {{ rendered }}
    </div>
  </div>
  {% if warnings %}
  <h1>Warnings</h1>
  <p>You must fix these warnings before you can submit your patch.</p>
  <ul>
    {% for warning in warnings %}
    <li>{{ warning }}</li>
    {% endfor %}
  </ul>
  {% endif %}
{% endif %}
  <h1 id="suggest-changes-for-this-page">Suggest changes for this page</h1>
{% if not rendered %}
  <p>Here you can edit the source of &#8220;{{ doctitle|striptags }}&#8221; and
    submit the results as a patch to the Python documentation team.  If you want
    to know more about reST, the markup language used, read
    <a href="{{ pathto('documenting/index.rst') }}">Documenting Python</a>.</p>
{% endif %}
  <form action="{{ submiturl }}" method="post">
    <div id="suggest-changes-box">
      <textarea name="contents">{{ contents|e }}</textarea>
      {# XXX: shortcuts to make the edit area larger/smaller #}
      {% if form_error %}
      <div class="error">{{ form_error|e }}</div>
      {% endif %}
      <dl>
        <dt>Name:</dt>
        <dd><input type="text" size="24" name="name" value="{{ author }}"></dd>
        <dt>E-mail Address:</dt>
        <dd><input type="text" size="24" name="email" value="{{ email }}"></dd>
        <dt>Summary of the change:</dt>
        <dd><input type="text" size="48" name="summary" value="{{ summary }}"></dd>
      </dl>
      <input type="text" name="homepage" size="12" id="homepage">
      <div class="actions">
        <input type="submit" value="Submit patch for review">
        <input type="submit" name="preview" value="Preview changes">
        <input type="reset" value="Reset form">
        <input type="submit" name="cancel" value="Cancel">
      </div>
    </div>
  </form>
{% endblock %}
